/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.cmc.service.merchant.service.persistence;

import com.cmc.service.merchant.model.AgentEntry;

import com.liferay.portal.service.persistence.BasePersistence;

/**
 * The persistence interface for the agent entry service.
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author ntcuong1
 * @see AgentEntryPersistenceImpl
 * @see AgentEntryUtil
 * @generated
 */
public interface AgentEntryPersistence extends BasePersistence<AgentEntry> {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this interface directly. Always use {@link AgentEntryUtil} to access the agent entry persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
	 */

	/**
	* Caches the agent entry in the entity cache if it is enabled.
	*
	* @param agentEntry the agent entry
	*/
	public void cacheResult(
		com.cmc.service.merchant.model.AgentEntry agentEntry);

	/**
	* Caches the agent entries in the entity cache if it is enabled.
	*
	* @param agentEntries the agent entries
	*/
	public void cacheResult(
		java.util.List<com.cmc.service.merchant.model.AgentEntry> agentEntries);

	/**
	* Creates a new agent entry with the primary key. Does not add the agent entry to the database.
	*
	* @param agentId the primary key for the new agent entry
	* @return the new agent entry
	*/
	public com.cmc.service.merchant.model.AgentEntry create(long agentId);

	/**
	* Removes the agent entry with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param agentId the primary key of the agent entry
	* @return the agent entry that was removed
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a agent entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry remove(long agentId)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	public com.cmc.service.merchant.model.AgentEntry updateImpl(
		com.cmc.service.merchant.model.AgentEntry agentEntry, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent entry with the primary key or throws a {@link com.cmc.service.merchant.NoSuchAgentEntryException} if it could not be found.
	*
	* @param agentId the primary key of the agent entry
	* @return the agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a agent entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry findByPrimaryKey(
		long agentId)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent entry with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param agentId the primary key of the agent entry
	* @return the agent entry, or <code>null</code> if a agent entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry fetchByPrimaryKey(
		long agentId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the agent entries where merchantId = &#63;.
	*
	* @param merchantId the merchant ID
	* @return the matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findByMerchant(
		long merchantId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the agent entries where merchantId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param merchantId the merchant ID
	* @param start the lower bound of the range of agent entries
	* @param end the upper bound of the range of agent entries (not inclusive)
	* @return the range of matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findByMerchant(
		long merchantId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the agent entries where merchantId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param merchantId the merchant ID
	* @param start the lower bound of the range of agent entries
	* @param end the upper bound of the range of agent entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findByMerchant(
		long merchantId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first agent entry in the ordered set where merchantId = &#63;.
	*
	* @param merchantId the merchant ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry findByMerchant_First(
		long merchantId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first agent entry in the ordered set where merchantId = &#63;.
	*
	* @param merchantId the merchant ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching agent entry, or <code>null</code> if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry fetchByMerchant_First(
		long merchantId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last agent entry in the ordered set where merchantId = &#63;.
	*
	* @param merchantId the merchant ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry findByMerchant_Last(
		long merchantId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last agent entry in the ordered set where merchantId = &#63;.
	*
	* @param merchantId the merchant ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching agent entry, or <code>null</code> if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry fetchByMerchant_Last(
		long merchantId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent entries before and after the current agent entry in the ordered set where merchantId = &#63;.
	*
	* @param agentId the primary key of the current agent entry
	* @param merchantId the merchant ID
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a agent entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry[] findByMerchant_PrevAndNext(
		long agentId, long merchantId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the agent entries where merchantId = &#63; and type = &#63;.
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @return the matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findByM_T(
		long merchantId, java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the agent entries where merchantId = &#63; and type = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @param start the lower bound of the range of agent entries
	* @param end the upper bound of the range of agent entries (not inclusive)
	* @return the range of matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findByM_T(
		long merchantId, java.lang.String type, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the agent entries where merchantId = &#63; and type = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @param start the lower bound of the range of agent entries
	* @param end the upper bound of the range of agent entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findByM_T(
		long merchantId, java.lang.String type, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first agent entry in the ordered set where merchantId = &#63; and type = &#63;.
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry findByM_T_First(
		long merchantId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the first agent entry in the ordered set where merchantId = &#63; and type = &#63;.
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the first matching agent entry, or <code>null</code> if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry fetchByM_T_First(
		long merchantId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last agent entry in the ordered set where merchantId = &#63; and type = &#63;.
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry findByM_T_Last(
		long merchantId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the last agent entry in the ordered set where merchantId = &#63; and type = &#63;.
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the last matching agent entry, or <code>null</code> if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry fetchByM_T_Last(
		long merchantId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent entries before and after the current agent entry in the ordered set where merchantId = &#63; and type = &#63;.
	*
	* @param agentId the primary key of the current agent entry
	* @param merchantId the merchant ID
	* @param type the type
	* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
	* @return the previous, current, and next agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a agent entry with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry[] findByM_T_PrevAndNext(
		long agentId, long merchantId, java.lang.String type,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent entry where code = &#63; or throws a {@link com.cmc.service.merchant.NoSuchAgentEntryException} if it could not be found.
	*
	* @param code the code
	* @return the matching agent entry
	* @throws com.cmc.service.merchant.NoSuchAgentEntryException if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry findByCode(
		java.lang.String code)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent entry where code = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param code the code
	* @return the matching agent entry, or <code>null</code> if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry fetchByCode(
		java.lang.String code)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the agent entry where code = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param code the code
	* @param retrieveFromCache whether to use the finder cache
	* @return the matching agent entry, or <code>null</code> if a matching agent entry could not be found
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry fetchByCode(
		java.lang.String code, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns all the agent entries.
	*
	* @return the agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns a range of all the agent entries.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of agent entries
	* @param end the upper bound of the range of agent entries (not inclusive)
	* @return the range of agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns an ordered range of all the agent entries.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of agent entries
	* @param end the upper bound of the range of agent entries (not inclusive)
	* @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
	* @return the ordered range of agent entries
	* @throws SystemException if a system exception occurred
	*/
	public java.util.List<com.cmc.service.merchant.model.AgentEntry> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the agent entries where merchantId = &#63; from the database.
	*
	* @param merchantId the merchant ID
	* @throws SystemException if a system exception occurred
	*/
	public void removeByMerchant(long merchantId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the agent entries where merchantId = &#63; and type = &#63; from the database.
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @throws SystemException if a system exception occurred
	*/
	public void removeByM_T(long merchantId, java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes the agent entry where code = &#63; from the database.
	*
	* @param code the code
	* @return the agent entry that was removed
	* @throws SystemException if a system exception occurred
	*/
	public com.cmc.service.merchant.model.AgentEntry removeByCode(
		java.lang.String code)
		throws com.cmc.service.merchant.NoSuchAgentEntryException,
			com.liferay.portal.kernel.exception.SystemException;

	/**
	* Removes all the agent entries from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of agent entries where merchantId = &#63;.
	*
	* @param merchantId the merchant ID
	* @return the number of matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public int countByMerchant(long merchantId)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of agent entries where merchantId = &#63; and type = &#63;.
	*
	* @param merchantId the merchant ID
	* @param type the type
	* @return the number of matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public int countByM_T(long merchantId, java.lang.String type)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of agent entries where code = &#63;.
	*
	* @param code the code
	* @return the number of matching agent entries
	* @throws SystemException if a system exception occurred
	*/
	public int countByCode(java.lang.String code)
		throws com.liferay.portal.kernel.exception.SystemException;

	/**
	* Returns the number of agent entries.
	*
	* @return the number of agent entries
	* @throws SystemException if a system exception occurred
	*/
	public int countAll()
		throws com.liferay.portal.kernel.exception.SystemException;
}